﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/MasterPagePrivate.master" AutoEventWireup="true" CodeFile="AdvertisementChange.aspx.cs" Inherits="Pages_Admin_AdvertisementChange" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageHeader" Runat="Server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="PageBody" Runat="Server">
    <h4 id="h4Heading" runat="server">Add Advertisement</h4>    
    <div id="divMessage" runat="server" visible="false" enableviewstate="false"></div>    
    <div class="clearboth"></div>
    
    <asp:Panel ID="pnlFormContainer" runat="server" DefaultButton="btnSave">
        <%--Advertisement Information Group Box Start--%>        
        
        <div class="WizardContainer">
            <div class="StepHeaderContainer">
                <div class="StepHeading">
                    <asp:Label ID="lblFormTitle" runat="server" Text="Advertisement"></asp:Label>
                </div>
                <div class="StepSubHeading"><asp:Label ID="lblFormSubTitle" runat="server" Text="Define the Advertisement, Title, Image/Flash and Positions"></asp:Label></div>
            </div>
            <div class="StepBody">
                <table cellpadding="3" cellspacing="0" style="width:70%;">
                    <colgroup>
                        <col style="width:30%;" />
                        <col />                                        
                    </colgroup>

				    <tr>
					    <td>Company/Customer<span class="requiredMark">*</span></td>
					    <td>
						    <asp:DropDownList ID="ddlCustomerID" runat="server"></asp:DropDownList>
						    <asp:RequiredFieldValidator ID="rfvCustomerID" runat="server"
							    ControlToValidate="ddlCustomerID" SetFocusOnError="true"
							    ErrorMessage="Please Select a Customer." Display="Dynamic"
							    ValidationGroup="SaveInfo">
						    </asp:RequiredFieldValidator>
					    </td>
				    </tr>
				    <tr>
					    <td>Advertisement Title<span class="requiredMark">*</span></td>
					    <td>
						    <asp:TextBox ID="txtName" MaxLength="150" runat="server"></asp:TextBox>
						    <asp:RequiredFieldValidator ID="rfvName" runat="server"
							    ControlToValidate="txtName" SetFocusOnError="true"
							    ErrorMessage="Please Enter a Title." Display="Dynamic"
							    ValidationGroup="SaveInfo">
						    </asp:RequiredFieldValidator>
					    </td>
				    </tr>

                    <tr>
					    <td>URL</td>
					    <td>
						    <asp:TextBox ID="txtLinkedUrl" MaxLength="250" runat="server"></asp:TextBox>
						    <asp:RegularExpressionValidator ID="revLinkedUrl" runat="server" 
                                ValidationExpression="^((http|https)://)?([\w-]+\.)+[\w]+(/[\w- ./?]*)?$"
                                ControlToValidate="txtLinkedUrl" Display="Dynamic" SetFocusOnError="true"
                                ErrorMessage="Please provide valid url."
                                ValidationGroup="SaveInfo">
                            </asp:RegularExpressionValidator>
					    </td>
				    </tr>

				    <tr>
					    <td>File Type<span class="requiredMark">*</span></td>
					    <td>
                            <asp:RadioButtonList ID="rdblFileType" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Text="Image" Value="I" Selected="True"></asp:ListItem>
                                <asp:ListItem Text="Flash" Value="F"></asp:ListItem>
                            </asp:RadioButtonList>
						    <%--<asp:TextBox ID="txtFileType" MaxLength="1" runat="server"></asp:TextBox>--%>
						    <%--<asp:RequiredFieldValidator ID="rfvFileType" runat="server"
							    ControlToValidate="txtFileType" SetFocusOnError="true"
							    ErrorMessage="Please Enter a FileType." Display="Dynamic"
							    ValidationGroup="SaveInfo">
						    </asp:RequiredFieldValidator>--%>
					    </td>
				    </tr>
				    <tr>
					    <td>File<span class="requiredMark">*</span></td>
					    <td>
                            <div id="divAddPreviewContainer" runat="server" visible="false" class="AdverstisementContainer"></div>
                            <asp:FileUpload ID="fuFile" runat="server" ToolTip="Select an Image file (*.jpg, *.jpeg, *.gif, *.png) or a Flash file (*.swf) for the Advertisement." />
						    <%--<asp:TextBox ID="txtFileName" MaxLength="250" runat="server"></asp:TextBox>--%>
                            <asp:RequiredFieldValidator ID="rfvFileName" runat="server"
							    ControlToValidate="fuFile" SetFocusOnError="true"
							    ErrorMessage="Please Select a File." Display="Dynamic"
							    ValidationGroup="SaveInfo">
						    </asp:RequiredFieldValidator>
						    <asp:CustomValidator ID="cvFileName" runat="server"
							    SetFocusOnError="true" Display="Dynamic" ValidateEmptyText="true"
                                OnServerValidate="cvFileName_OnServerValidate"
							    ErrorMessage="Please Select a Valid Image or Flash File for Advertisement."
							    ValidationGroup="SaveInfo">
						    </asp:CustomValidator>
					    </td>
				    </tr>
				    <tr>
					    <td>Sort Order<span class="requiredMark">*</span></td>
					    <td>
						    <asp:TextBox ID="txtSortOrder" MaxLength="4" runat="server" Text="0" style="width:50px;"></asp:TextBox>
						    <asp:RequiredFieldValidator ID="rfvSortOrder" runat="server"
							    ControlToValidate="txtSortOrder" SetFocusOnError="true"
							    ErrorMessage="<br />Please Enter a Sort Order." Display="Dynamic"
							    ValidationGroup="SaveInfo">
						    </asp:RequiredFieldValidator>
                            <asp:CompareValidator ID="cvSortOrder" runat="server"
							    ControlToValidate="txtSortOrder" Display="Dynamic" SetFocusOnError="true"
                                Type="Integer" Operator="DataTypeCheck"
							    ErrorMessage="<br />Please Enter Sort Order in Digits only."
							    ValidationGroup="SaveInfo">
						    </asp:CompareValidator>
					    </td>
				    </tr>
				    <tr>
					    <td>Is Active?<span class="requiredMark">*</span></td>
					    <td>
						    <asp:CheckBox ID="chkIsActive" runat="server" Checked="true"/>						
					    </td>
				    </tr>
				    <tr>
					    <td>Position<span class="requiredMark">*</span></td>
					    <td>
                            <asp:RadioButtonList ID="rdblPosition" runat="server" RepeatDirection="Horizontal">
                                <asp:ListItem Text="Left" Value="Left"></asp:ListItem>
                                <asp:ListItem Text="Right" Value="Right"></asp:ListItem>
                            </asp:RadioButtonList>
						    <%--<asp:TextBox ID="txtPosition" MaxLength="5" runat="server"></asp:TextBox>--%>
						    <asp:RequiredFieldValidator ID="rfvPosition" runat="server"
							    ControlToValidate="rdblPosition" SetFocusOnError="true"
							    ErrorMessage="Please Select a Position." Display="Dynamic"
							    ValidationGroup="SaveInfo">
						    </asp:RequiredFieldValidator>
					    </td>
				    </tr>
				    <tr>
					    <td>Is Home PageBanner?<span class="requiredMark">*</span></td>
					    <td>
						    <asp:CheckBox ID="chkIsHomePageBanner" runat="server"/>						
					    </td>
				    </tr>				                  
                </table>
            </div>
            <div class="StepButtonContainer">
                <asp:Button ID="btnSave" runat="server" Text="Save" ValidationGroup="SaveInfo" OnClick="btnSave_Click" />            
                <asp:Button ID="btnList" runat="server" Text="Advertisement List" CssClass="ButtonInActive" OnClick="btnList_Click" />            
            </div>
        </div>
        <%--Advertisement Information Group Box End--%>
    </asp:Panel> 
</asp:Content>

